var util = require('../../../utils/util.js');
var api = require('../../../config/api.js');
var user = require('../../../services/user.js');
var app = getApp();

Page({
  data: {
    gradeList:[],
    indicatorDots:false,
    autoplay:false,
    interval:5000,
    duration:1000
  },
  swiperChange(e) {
    const that = this;
    that.setData({
      swiperIndex:e.detail.current
    })
  },
  onLoad: function (options) {
    let that = this;
    util.request(api.GetVipLevel).then(function (res) {
      if (res.errno === 0) {
        let getData = JSON.parse(res.data.name);
        that.setData({
          gradeList: [
            { 'gradeName': '高级会员', gradeParamOne: getData.param1, gradeParamTwo: '', contOne: '直接推荐', contTwo: '个普通会员完成注册。', contThree: "" },
            { 'gradeName': '掌柜', gradeParamOne: getData.param2, gradeParamTwo: getData.param3, contOne: '直接推荐', contTwo: '个会员完成注册并且直接+间接推荐人累计销售额>=', contThree: "元。" },
            { 'gradeName': '运营商', gradeParamOne: getData.param4, gradeParamTwo: getData.param5, contOne: '发展', contTwo: '个掌柜并且直接+间接推荐人累计销售额>=', contThree: "元。" },
            { 'gradeName': '合伙人', gradeParamOne: getData.param6, gradeParamTwo: getData.param7, contOne: '发展', contTwo: '运营商并且直接+间接推荐人累计销售额达到', contThree: "元。" }
          ]
        });
      }
    });
  },
  onReady: function () {

  },
  onShow: function () {

  },
  onPullDownRefresh: function () {

  },
  onReachBottom: function () {

  }
})